#!/usr/bin/env python




##################################################
## DEPENDENCIES
import sys
import os
import os.path
from os.path import getmtime, exists
import time
import types
import __builtin__
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
from Cheetah.Template import Template
from Cheetah.DummyTransaction import DummyTransaction
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
from Cheetah.CacheRegion import CacheRegion
import Cheetah.Filters as Filters
import Cheetah.ErrorCatchers as ErrorCatchers

##################################################
## MODULE CONSTANTS
try:
    True, False
except NameError:
    True, False = (1==1), (1==0)
VFFSL=valueFromFrameOrSearchList
VFSL=valueFromSearchList
VFN=valueForName
currentTime=time.time
__CHEETAH_version__ = '2.0.1'
__CHEETAH_versionTuple__ = (2, 0, 1, 'final', 0)
__CHEETAH_genTime__ = 1231844000.2030001
__CHEETAH_genTimestamp__ = 'Tue Jan 13 18:53:20 2009'
__CHEETAH_src__ = 'atomFile.tmpl'
__CHEETAH_srcLastModified__ = 'Tue Jan 13 18:52:38 2009'
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'

if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
    raise AssertionError(
      'This template was compiled with Cheetah version'
      ' %s. Templates compiled before version %s must be recompiled.'%(
         __CHEETAH_version__, RequiredCheetahVersion))

##################################################
## CLASSES

class atomFile(Template):

    ##################################################
    ## CHEETAH GENERATED METHODS


    def __init__(self, *args, **KWs):

        Template.__init__(self, *args, **KWs)
        if not self._CHEETAH__instanceInitialized:
            cheetahKWArgs = {}
            allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
            for k,v in KWs.items():
                if k in allowedKWs: cheetahKWArgs[k] = v
            self._initCheetahInstance(**cheetahKWArgs)
        

    def respond(self, trans=None):



        ## CHEETAH: main method generated for this template
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write("""<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom'
\txmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'>
\t<title type='text'>""")
        _v = VFSL([locals()]+SL+[globals(), __builtin__],"atom.title",True) # '$atom.title' on line 4, col 21
        if _v is not None: write(_filter(_v, rawExpr='$atom.title')) # from line 4, col 21.
        write('''</title>
\t<author>
\t\t<name>''')
        _v = VFSL([locals()]+SL+[globals(), __builtin__],"atom.gmail",True) # '$atom.gmail' on line 6, col 9
        if _v is not None: write(_filter(_v, rawExpr='$atom.gmail')) # from line 6, col 9.
        write('''</name>
\t\t<email>''')
        _v = VFSL([locals()]+SL+[globals(), __builtin__],"atom.gmail",True) # '$atom.gmail' on line 7, col 10
        if _v is not None: write(_filter(_v, rawExpr='$atom.gmail')) # from line 7, col 10.
        write("""</email>
\t</author>
\t<generator version='1.0' uri='http://www.google.com/notebook'>
\t\tGoogle Notebook
\t</generator>
\t<entry>
\t\t<id>tid</id>
\t\t<category scheme='http://schemas.google.com/g/2005#kind'
\t\t\tterm='http://schemas.google.com/notebook/2008/kind#section' />
\t\t<title type='text'></title>
\t\t<content type='text'></content>
\t</entry>
""")
        for wzNote in VFSL([locals()]+SL+[globals(), __builtin__],"atom.wzNotes",True): # generated from line 19, col 2
            write('''\t<entry>
\t\t<updated>''')
            _v = VFSL([locals()]+SL+[globals(), __builtin__],"wzNote.updateTime",True) # '$wzNote.updateTime' on line 21, col 12
            if _v is not None: write(_filter(_v, rawExpr='$wzNote.updateTime')) # from line 21, col 12.
            write("""</updated>
\t\t<category scheme='http://schemas.google.com/g/2005#kind'
\t\t\tterm='http://schemas.google.com/notebook/2008/kind#note' />
\t\t<category
\t\t\tscheme='http://schemas.google.com/notebook/gdata/2007/section'
\t\t\tterm='tid' label='' />
""")
            for tag in VFSL([locals()]+SL+[globals(), __builtin__],"wzNote.tags",True): # generated from line 27, col 3
                write("""\t\t<category scheme='http://schemas.google.com/g/2005/label'
\t\t\tterm='""")
                _v = VFSL([locals()]+SL+[globals(), __builtin__],"tag",True) # '$tag' on line 29, col 10
                if _v is not None: write(_filter(_v, rawExpr='$tag')) # from line 29, col 10.
                write("""' />
""")
            write("""\t\t<title type='text'>""")
            _v = VFSL([locals()]+SL+[globals(), __builtin__],"wzNote.title",True) # '$wzNote.title' on line 31, col 22
            if _v is not None: write(_filter(_v, rawExpr='$wzNote.title')) # from line 31, col 22.
            write("""</title>
\t\t<content type='html'>""")
            _v = VFSL([locals()]+SL+[globals(), __builtin__],"wzNote.abstract",True) # '$wzNote.abstract' on line 32, col 24
            if _v is not None: write(_filter(_v, rawExpr='$wzNote.abstract')) # from line 32, col 24.
            write("""</content>
\t\t<link rel='related' type='text/html'
\t\t\thref='""")
            _v = VFSL([locals()]+SL+[globals(), __builtin__],"wzNote.url",True) # '$wzNote.url' on line 34, col 10
            if _v is not None: write(_filter(_v, rawExpr='$wzNote.url')) # from line 34, col 10.
            write("""'
\t\t\ttitle='""")
            _v = VFSL([locals()]+SL+[globals(), __builtin__],"wzNote.title",True) # '$wzNote.title' on line 35, col 11
            if _v is not None: write(_filter(_v, rawExpr='$wzNote.title')) # from line 35, col 11.
            write("""' />
\t\t<author>
\t\t\t<name>""")
            _v = VFSL([locals()]+SL+[globals(), __builtin__],"atom.gmail",True) # '$atom.gmail' on line 37, col 10
            if _v is not None: write(_filter(_v, rawExpr='$atom.gmail')) # from line 37, col 10.
            write('''</name>
\t\t</author>
\t</entry>
''')
        write('''</feed>''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        
    ##################################################
    ## CHEETAH GENERATED ATTRIBUTES


    _CHEETAH__instanceInitialized = False

    _CHEETAH_version = __CHEETAH_version__

    _CHEETAH_versionTuple = __CHEETAH_versionTuple__

    _CHEETAH_genTime = __CHEETAH_genTime__

    _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__

    _CHEETAH_src = __CHEETAH_src__

    _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__

    _mainCheetahMethod_for_atomFile= 'respond'

## END CLASS DEFINITION

if not hasattr(atomFile, '_initCheetahAttributes'):
    templateAPIClass = getattr(atomFile, '_CHEETAH_templateClass', Template)
    templateAPIClass._addCheetahPlumbingCodeToClass(atomFile)


# CHEETAH was developed by Tavis Rudd and Mike Orr
# with code, advice and input from many other volunteers.
# For more information visit http://www.CheetahTemplate.org/

##################################################
## if run from command line:
if __name__ == '__main__':
    from Cheetah.TemplateCmdLineIface import CmdLineIface
    CmdLineIface(templateObj=atomFile()).run()


